﻿@using Orchard.Utility.Extensions
@{
    IEnumerable<Tuple<string, string>> widgetTypes = Model.WidgetTypes;
    bool enableHiddenZones = Model.EnableHiddenZones;
}
<style type="text/css">
	#toolbar {
		background:#F1F1F1;
		border-bottom:1px solid #494d4d;
		border-right:1px solid #494d4d;
		left:0;
		height:100%;
		margin:0;
		position:absolute;
		padding:5px;
		top:0;
		width:300px;
		line-height: 1.45;
		font-family: "Segoe UI","Segoe WP","Helvetica Neue",'RobotoRegular',sans-serif !important;
	}

	#toolbar h1, 
	#toolbar h2,
	#toolbar h3,
	#toolbar h4,
	#toolbar h5,
	#toolbar h6 {
		font-family: "Segoe UI Light","Helvetica Neue",'RobotoLight',"Segoe UI","Segoe WP",sans-serif;
		font-weight: 100;
		margin-bottom: 0;
		margin-top: 5px;
		text-transform: lowercase;
	}

	#toolbar h1 {
		font-size: 56px;
	}
	#toolbar h2 {
		font-size: 42px;
	}
	#toolbar h3 {
		font-size: 28px;
	}
	#toolbar h4, 
	#toolbar h5, 
	#toolbar h6 {
		font-weight: normal;
		text-transform: uppercase;
	}

	#toolbar ul {
		list-style: none;
	}

	#toolbar li {
		height: 20px;
		margin: 2.5px 0;
		padding: 2.5px 0;
	}

	#toolbar li.toolbox-widget {
		background-image: url("modules/ngm.portlets/Content/move.png");
        background-position: right center;
        background-repeat: no-repeat;
		border: 1px #EAEAEA solid;
		cursor: move;
    }

    #toolbar li.toolbox-widget:hover {
		background-color: #E6E6FA;
	}

</style>
<script src="/OrchardLocal/Modules/NGM.Portlets/scripts/orchard-toolbelt.js" type="text/javascript"></script>

<div id="toolbar">
    <h3>@T("Orchard Toolbelt")</h3>
    @using (Html.BeginFormAntiForgeryPost(Url.Action("Update", new { Controller = "Toolbar", Area = "NGM.Portlets", ReturnUrl = HttpContext.Current.Request.RawUrl }), FormMethod.Post, new { @class = "inline" })) { 
        <h4>@T("Zones")</h4>
        <ul>
            <li>
                @Html.CheckBox("EnableHiddenZones", enableHiddenZones, new { id = "enablehiddenzones", onChange = "this.form.submit();" })
                <label class="forcheckbox" for="enablehiddenzones">@T("Enable hidden zones")</label>
            </li>
        </ul>
        <h4>@T("Widgets")</h4>
        <p class="hint">@T("Drag widget on to canvas")</p>
        if (widgetTypes.Any()) {
        <ul id="widgets-available">
            @foreach (var widgetType in widgetTypes.OrderBy(type => (string)type.Item1)) {
                string name = widgetType.Item1;
                string description = widgetType.Item2;
            <li class="toolbox-widget">
                @name.CamelFriendly()
                @if (!string.IsNullOrWhiteSpace(description)) {
                <p>@description</p>
                }
            </li>
            }
        </ul>
        }
        else {
        <p>@T("There are no widgets available to add.")</p>
        }
        <h4>@T("Content")</h4>
        <ul>
            @foreach (var type in Model.ContentTypes) {
                <p>@Html.ActionLink((@T("Add a new ") + (string)type.DisplayName).CamelFriendly(), "Create", new { Area = "Contents", Id = (string)type.Name, ContainerId = Model.ContainerId, ReturnUrl = Request.QueryString["ReturnUrl"] })</p>
            }
        </ul>
    }
</div>